#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    int i , j , k ,count=0;
    for (i=0; i <= n / 5; i++)
    {
        for (j=0; j <= (n-i*5)/3; j++)
        {
            k = (n -  i*5 - j*3)*3;
            
                if (i+j+k==n)
                {
                    cout << i << "," << j << "," << k << endl;
                    count++;
                }
            
        }
    }
    cout << "Solution count: " << count << ".";



    return 0;
}